/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.dengues.model.component.impl;

import org.dengues.model.component.ComponentPackage;
import org.dengues.model.component.HEADERType;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>HEADER Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.dengues.model.component.impl.HEADERTypeImpl#getEXTENSION <em>EXTENSION</em>}</li>
 *   <li>{@link org.dengues.model.component.impl.HEADERTypeImpl#isSTARTABLE <em>STARTABLE</em>}</li>
 *   <li>{@link org.dengues.model.component.impl.HEADERTypeImpl#getVERSION <em>VERSION</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class HEADERTypeImpl extends EObjectImpl implements HEADERType {
    /**
     * The default value of the '{@link #getEXTENSION() <em>EXTENSION</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getEXTENSION()
     * @generated
     * @ordered
     */
    protected static final String EXTENSION_EDEFAULT = null;

    /**
     * The cached value of the '{@link #getEXTENSION() <em>EXTENSION</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getEXTENSION()
     * @generated
     * @ordered
     */
    protected String eXTENSION = EXTENSION_EDEFAULT;

    /**
     * The default value of the '{@link #isSTARTABLE() <em>STARTABLE</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isSTARTABLE()
     * @generated
     * @ordered
     */
    protected static final boolean STARTABLE_EDEFAULT = false;

    /**
     * The cached value of the '{@link #isSTARTABLE() <em>STARTABLE</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isSTARTABLE()
     * @generated
     * @ordered
     */
    protected boolean sTARTABLE = STARTABLE_EDEFAULT;

    /**
     * This is true if the STARTABLE attribute has been set.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     * @ordered
     */
    protected boolean sTARTABLEESet;

    /**
     * The default value of the '{@link #getVERSION() <em>VERSION</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getVERSION()
     * @generated
     * @ordered
     */
    protected static final String VERSION_EDEFAULT = null;

    /**
     * The cached value of the '{@link #getVERSION() <em>VERSION</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getVERSION()
     * @generated
     * @ordered
     */
    protected String vERSION = VERSION_EDEFAULT;

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected HEADERTypeImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return ComponentPackage.Literals.HEADER_TYPE;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getEXTENSION() {
        return eXTENSION;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setEXTENSION(String newEXTENSION) {
        String oldEXTENSION = eXTENSION;
        eXTENSION = newEXTENSION;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.HEADER_TYPE__EXTENSION, oldEXTENSION, eXTENSION));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isSTARTABLE() {
        return sTARTABLE;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setSTARTABLE(boolean newSTARTABLE) {
        boolean oldSTARTABLE = sTARTABLE;
        sTARTABLE = newSTARTABLE;
        boolean oldSTARTABLEESet = sTARTABLEESet;
        sTARTABLEESet = true;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.HEADER_TYPE__STARTABLE, oldSTARTABLE, sTARTABLE, !oldSTARTABLEESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void unsetSTARTABLE() {
        boolean oldSTARTABLE = sTARTABLE;
        boolean oldSTARTABLEESet = sTARTABLEESet;
        sTARTABLE = STARTABLE_EDEFAULT;
        sTARTABLEESet = false;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.UNSET, ComponentPackage.HEADER_TYPE__STARTABLE, oldSTARTABLE, STARTABLE_EDEFAULT, oldSTARTABLEESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isSetSTARTABLE() {
        return sTARTABLEESet;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getVERSION() {
        return vERSION;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setVERSION(String newVERSION) {
        String oldVERSION = vERSION;
        vERSION = newVERSION;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.HEADER_TYPE__VERSION, oldVERSION, vERSION));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case ComponentPackage.HEADER_TYPE__EXTENSION:
                return getEXTENSION();
            case ComponentPackage.HEADER_TYPE__STARTABLE:
                return isSTARTABLE() ? Boolean.TRUE : Boolean.FALSE;
            case ComponentPackage.HEADER_TYPE__VERSION:
                return getVERSION();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case ComponentPackage.HEADER_TYPE__EXTENSION:
                setEXTENSION((String)newValue);
                return;
            case ComponentPackage.HEADER_TYPE__STARTABLE:
                setSTARTABLE(((Boolean)newValue).booleanValue());
                return;
            case ComponentPackage.HEADER_TYPE__VERSION:
                setVERSION((String)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case ComponentPackage.HEADER_TYPE__EXTENSION:
                setEXTENSION(EXTENSION_EDEFAULT);
                return;
            case ComponentPackage.HEADER_TYPE__STARTABLE:
                unsetSTARTABLE();
                return;
            case ComponentPackage.HEADER_TYPE__VERSION:
                setVERSION(VERSION_EDEFAULT);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case ComponentPackage.HEADER_TYPE__EXTENSION:
                return EXTENSION_EDEFAULT == null ? eXTENSION != null : !EXTENSION_EDEFAULT.equals(eXTENSION);
            case ComponentPackage.HEADER_TYPE__STARTABLE:
                return isSetSTARTABLE();
            case ComponentPackage.HEADER_TYPE__VERSION:
                return VERSION_EDEFAULT == null ? vERSION != null : !VERSION_EDEFAULT.equals(vERSION);
        }
        return super.eIsSet(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public String toString() {
        if (eIsProxy()) return super.toString();

        StringBuffer result = new StringBuffer(super.toString());
        result.append(" (eXTENSION: ");
        result.append(eXTENSION);
        result.append(", sTARTABLE: ");
        if (sTARTABLEESet) result.append(sTARTABLE); else result.append("<unset>");
        result.append(", vERSION: ");
        result.append(vERSION);
        result.append(')');
        return result.toString();
    }

} //HEADERTypeImpl
